<%@page contentType="text/html"%>  
<%@page pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>  
<%@taglib uri="http://richfaces.org/a4j" prefix="a4j"%>  
<%@taglib uri="http://richfaces.org/rich" prefix="rich"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"   
"http://www.w3.org/TR/html4/loose.dtd">  
<html>
    <head>
        <title>Usuário</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta http-equiv="Pragma" content="no-cache">
        <meta http-equiv="cache-control" content="no-cache">
        <meta http-equiv="cache-control" content="no-store">
        <meta http-equiv="expires" content="0">

        <script type="text/javascript" src="../_js/dFilter.js"></script>
        <script type="text/javascript" src="../_js/valores.js"></script>
    </head>
    <style type="text/css"><!--@import url("../_css/style.css");--></style>
    <body>
        <f:view>
            <rich:panel>
                <f:facet name="header">
                    <h:outputText value="Usuário"/>
                </f:facet>
                <a4j:form id="frmUsuario" status="modalStatus">
                    <a4j:commandButton value="Salvar" action="#{UsuarioBean.salvar}"/>&nbsp;&nbsp;
                    <a4j:commandButton value="Retornar" action="#{UsuarioBean.pesquisar}" immediate="true"/>&nbsp;&nbsp;
                    <br><br>
                    <h:inputHidden value="#{UsuarioBean.id}" id="id"/>
                    <h:panelGrid columns="3">
                        <h:outputLabel value="Nome *" for="nome"/>
                        <h:inputText value="#{UsuarioBean.nome}" id="nome" required="true" maxlength="45" style="width:400px;" requiredMessage="Campo Requerido."/>
                        <rich:message for="nome" style="color:red;"/>
                        
                        <h:outputLabel value="Regra *"/>
                        <rich:comboBox id="regraSelecionado" value="#{UsuarioBean.regraSelecionado}" defaultLabel="Regra Acesso" enableManualInput="false" required="true" requiredMessage="Campo Requerido.">
                            <f:selectItems value="#{UsuarioBean.dadosRegra}"/>
                        </rich:comboBox>
                        <rich:message for="regraSelecionado" style="color:red;"/>
                        
                        <h:outputLabel value="Login *"/>
                        <h:inputText value="#{UsuarioBean.login}" id="login" maxlength="25" style="width:200px;" required="true" requiredMessage="Campo Requerido."/>
                        <rich:message for="login" style="color:red;"/>
                        
                        <h:outputLabel value="Senha *"/>
                        <h:inputSecret value="#{UsuarioBean.senha}" id="senha" maxlength="25" style="width:200px;" required="true" requiredMessage="Campo Requerido."/>
                        <rich:message for="senha" style="color:red;"/>

                    </h:panelGrid><br>
                    <table>
                        <tr>
                            <td><strong>Menu / Regra</strong></td>
                            <td><strong>Administrador</strong></td>
                            <td><strong>Financeiro</strong></td>
                            <td><strong>Operacional</strong></td>
                        </tr>
                        <tr>
                            <td><strong>Cadastros</strong> > Administrador > Usuário</td>
                            <td align="center"><h:graphicImage url="../../_images/passed.gif"/></td>
                            <td align="center"><h:graphicImage url="../../_images/error.gif"/></td>
                            <td align="center"><h:graphicImage url="../../_images/error.gif"/></td>
                        </tr>
                        <tr>
                            <td><strong>Cadastros</strong> > Financeiro > Forma de Pagamento</td>
                            <td align="center"><h:graphicImage url="../../_images/passed.gif"/></td>
                            <td align="center"><h:graphicImage url="../../_images/error.gif"/></td>
                            <td align="center"><h:graphicImage url="../../_images/error.gif"/></td>
                        </tr>
                        <tr>
                            <td><strong>Cadastros</strong> > Financeiro > Tipo de Lançamento</td>
                            <td align="center"><h:graphicImage url="../../_images/passed.gif"/></td>
                            <td align="center"><h:graphicImage url="../../_images/error.gif"/></td>
                            <td align="center"><h:graphicImage url="../../_images/error.gif"/></td>
                        </tr>
                        <tr>
                            <td><strong>Cadastros</strong> > Operacional > Fornecedor</td>
                            <td align="center"><h:graphicImage url="../../_images/passed.gif"/></td>
                            <td align="center"><h:graphicImage url="../../_images/passed.gif"/></td>
                            <td align="center"><h:graphicImage url="../../_images/error.gif"/></td>
                        </tr>
                        <tr>
                            <td><strong>Cadastros</strong> > Operacional > Marca</td>
                            <td align="center"><h:graphicImage url="../../_images/passed.gif"/></td>
                            <td align="center"><h:graphicImage url="../../_images/passed.gif"/></td>
                            <td align="center"><h:graphicImage url="../../_images/error.gif"/></td>
                        </tr>
                        <tr>
                            <td><strong>Cadastros</strong> > Operacional > Produto</td>
                            <td align="center"><h:graphicImage url="../../_images/passed.gif"/></td>
                            <td align="center"><h:graphicImage url="../../_images/passed.gif"/></td>
                            <td align="center"><h:graphicImage url="../../_images/error.gif"/></td>
                        </tr>
                        <tr>
                            <td><strong>Operacional</strong> > Compras</td>
                            <td align="center"><h:graphicImage url="../../_images/passed.gif"/></td>
                            <td align="center"><h:graphicImage url="../../_images/passed.gif"/></td>
                            <td align="center"><h:graphicImage url="../../_images/error.gif"/></td>
                        </tr>
                        <tr>
                            <td><strong>Operacional</strong> > Vendas</td>
                            <td align="center"><h:graphicImage url="../../_images/passed.gif"/></td>
                            <td align="center"><h:graphicImage url="../../_images/passed.gif"/></td>
                            <td align="center"><h:graphicImage url="../../_images/passed.gif"/></td>
                        </tr>
                    </table>

                </a4j:form>
            </rich:panel>

            <a4j:status id="modalStatus" onstart="Richfaces.showModalPanel('ajaxLoadingModalBox')"
            onstop="Richfaces.hideModalPanel('ajaxLoadingModalBox')" />
            <rich:modalPanel id="ajaxLoadingModalBox" zindex="20000" autosized="true">
                <h:outputText value="Carregando"/><br>
                <h:graphicImage value="../_images/img_load.gif"/>
            </rich:modalPanel>

        </f:view>
    </body>
</html>